<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    	               "http://www.w3.org/TR/html4/loose.dtd">

<html>
	<head>
		<link href="Standard.css" rel="stylesheet" type="text/css">
	  	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	  	<title>Home</title>
	</head>
	<body>
		<%@include file="header.jsp" %>
		<div id="profile">
			<h1><%=stateful.getLoggedInMember().getMemName()%></h1>
			
			<h3>Suggested Caches</h3>
				<ul>
					<li>Cache #1</li><br class="clearBoth"/>
					<li>Cache #2</li><br class="clearBoth"/>
					<li>Cache #3</li><br class="clearBoth"/>
				</ul>	
							
			<h3>Recent Caches</h3>
				<ul>
					<li>Cache #1</li><br class="clearBoth"/>
					<li>Cache #2</li><br class="clearBoth"/>
					<li>Cache #3</li><br class="clearBoth"/>
				</ul>

			<h3>Personal Caches</h3>	
				<ul>
					<!-- Took out revision histories from here. -->
					<% 
						List<Cache> c = stateful.getMemberCaches();
						
						for(int i = 0; i < c.size(); i++)
						{
							
					%>
					
							<li><%=c.get(i).getCacheName()%></li>
							<a href="edit.jsp?ID=<%=c.get(i).getCacheId()%>" class="standardButton3">Edit C</a>
							<a href="addHeader.jsp?ID=<%=c.get(i).getCacheId()%>" class="standardButton3">Add Header</a>
							<br class="clearBoth"/>
							<li>
								<ul>
								<%
								//Gets all headers associated with the cache at position "i" in the array
								int id = c.get(i).getCacheId();
								List<Header> h = stateless.getAllHeadersFromCache(id);
								for(int j = 0; j < h.size(); j++)
								{
								%>
									
									<li class="headerItem"><%=h.get(j).getHeadTitle()%></li>
									<a href="editHeader.jsp?ID=<%=h.get(j).getHeadId() %>" class="standardButton3">Edit H</a>
									<br class="clearBoth"/>
									
								<%
								}
								%>
								</ul>
							</li>
					<% 
						}
					%>
				</ul>	
		
		</div>
		<div id="footer"></div>
	</body>
</html> 